for port in `seq 7001 7006`; do \
 mkdir -p ./redis-cluster/${port}/conf \
 && PORT=${port} envsubst < ./redis-cluster.tmpl > ./redis-cluster/${port}/conf/redis.conf \
 && mkdir -p ./redis-cluster/${port}/data; \
done


开放端口

for port in `seq 7001 7006`; do \
 firewall-cmd --add-port=${port}/tcp --permanent
done


for port in `seq 17001 17006`; do \
 firewall-cmd --add-port=${port}/tcp --permanent
done

firewall-cmd --reload

直接命令行执行 上面的命令




for port in `seq 6379 6381`; do \
 firewall-cmd --add-port=${port}/tcp --permanent
done

for port in `seq 26379 26381`; do \
 firewall-cmd --add-port=${port}/tcp --permanent
done